package dssd.auditoria;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import dssd.modelo.Usuario;

public class AuditLog {
	
	private long id;
	private String serviceName;
	private Usuario user;
	private Date date;
	private List<ItemLog> itemsLog = new ArrayList<ItemLog>();
	

	public List<ItemLog> getItemsLog() {
		return itemsLog;
	}

	public void setItemsLog(List<ItemLog> itemsLog) {
		this.itemsLog = itemsLog;
	}

	public AuditLog() {
		super();
	}

	public AuditLog(String serviceName, Usuario user) {
		this();
		this.date = new Date();
		this.serviceName = serviceName;
		this.user = user;
		this.itemsLog = new ArrayList<ItemLog>();
	}

	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @return the serviceName
	 */
	public String getServiceName() {
		return serviceName;
	}

	/**
	 * @param serviceName the serviceName to set
	 */
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	/**
	 * @return the user
	 */
	public Usuario getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(Usuario user) {
		this.user = user;
	}

	/**
	 * @return the date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * @param date the date to set
	 */
	public void setDate(Date date) {
		this.date = date;
	}
	
	public void agregarItem(ItemLog item){
		this.itemsLog.add(item);
	}
}